module.exports = app => {
    const seq = app.Sequelize;

    const Shopred = app.model.define('shopred', {
        id:{
            type:seq.INTEGER,
            autoIncrement:true,
            allowNull:false,
            primaryKey:true,
            unique:true
        },
        name:{
            type:seq.STRING,
            allowNull:false
        },
        address: {
            type:seq.STRING,
            allowNull:true
        },
        logo: {
            type:seq.STRING,
            allowNull:true,
        },
        wishing:{
            type:seq.STRING,
            allowNull:false,
        },
        actName:{
            type:seq.STRING,
            allowNull:false,
        },
        longitude:{
            type:seq.DOUBLE,
            allowNull:false,
        },
        latitude:{
            type:seq.DOUBLE,
            allowNull:false,
        },
        distance:{
            type:seq.DOUBLE,
            allowNull:false,
        },
        remark:{
            type:seq.STRING,
            allowNull:false,
        }
    },{
        timestamps:true,
        paranoid:true,
        underscored:false
    });

    Shopred.associate=function () {
        app.model.Shopred.hasMany(app.model.ShopredRed);
        app.model.Shopred.hasMany(app.model.ShopredRecord);
        app.model.Shopred.hasMany(app.model.ShopredConfig);
    };


    return Shopred;
};